//package com.wangyadong.hobby.front.model;
//
//import com.wangyadong.hobby.front.model.bean.My;
//import com.wangyadong.hobby.front.model.bean.MyString;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Qualifier;
//import org.springframework.context.*;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.context.event.ContextRefreshedEvent;
//import org.springframework.stereotype.Service;
//
//import java.util.HashSet;
//import java.util.Set;
//import java.util.concurrent.atomic.AtomicInteger;
//
//@Service
//public class MyFirstAutowireTest/* extends ContextRefreshedEvent*/ implements ApplicationListener, ApplicationEventPublisherAware {
//    //    @Autowired
////    @Qualifier("my1")
////    private MyString<String> my;
//
//
//
//   public int i;
//   public int j;
//   public int l;
//    public MyFirstAutowireTest() {
//
//        System.out.println(Thread.currentThread().getName() + " visit default contraut--> " + atomicInteger.incrementAndGet() + " MyFirstAutowireTest hashCode is " + getClass().hashCode());
//    }
//
//    public MyFirstAutowireTest(int i, int j, int l) {
//        this.i=i;
//        this.j=j;
//        this.l=l;
//        System.out.println(Thread.currentThread().getName() + " visit MyFirstAutowireTest contraut--> " + atomicInteger.incrementAndGet() + " MyFirstAutowireTest hashCode is " + getClass().hashCode());
//    }
//
//    private ApplicationContext applicationContext;
//    private ApplicationEvent applicationEvent;
//    private ApplicationEventPublisher applicationEventPublisher;
//
//    private AtomicInteger atomicInteger = new AtomicInteger();
//
//    public MyFirstAutowireTest(ApplicationContext source) {
//        System.out.println(Thread.currentThread().getName() + " visit ApplicationContext--> " + atomicInteger.incrementAndGet());
//        System.out.println("atomicInteger hasCode is" + atomicInteger.hashCode() + " MyFirstAutowireTest hashCode is " + getClass().hashCode());
//        this.applicationContext = source;
//    }
//
//    @Override
//    public void onApplicationEvent(ApplicationEvent applicationEvent) {
//        this.applicationEvent = applicationEvent;
//        System.out.println(Thread.currentThread().getName() + " visit applicationEvent--> " + atomicInteger.incrementAndGet());
//        Object source = applicationEvent.getSource();
//    }
//
//    @Override
//    public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) {
//        this.applicationEventPublisher = applicationEventPublisher;
//        applicationEventPublisher.publishEvent(this);
//        System.out.println(Thread.currentThread().getName() + " visit  applicationEventPublisher--> " + atomicInteger.incrementAndGet());
//    }
//}
